

using System;
using System.Collections.Generic;
using System.Text;
using EntityLayer;
using System.Data;
using DataAccessLayer;
using InfraStructureLayer;

namespace DataLayer
{
	public class datLinkContents
	{
		public datLinkContents()
		{
		}
		
		#region  Code Factory Generated Methods
        public void DeleteLinkContentsByLinkContentId(entLinkContents parEntLinkContents, DbConnector parDbConnector)
        {
            DbParamCollection insDbParamCollection = new DbParamCollection();
            insDbParamCollection.Add("@pLinkContentId", parEntLinkContents.LinkContentId);
            parDbConnector.ExecuteNonQuery("DeleteLinkContentsByLinkContentId", insDbParamCollection);
        }
        public void InsertLinkContents(entLinkContents parEntLinkContents, DbConnector parDbConnector)
        {
            DbParamCollection insDbParamCollection = new DbParamCollection();
            insDbParamCollection.Add("@pLinkId", parEntLinkContents.LinkId);
            insDbParamCollection.Add("@pLanguageId", parEntLinkContents.LanguageId);
            insDbParamCollection.Add("@pLinkName", parEntLinkContents.LinkName);
            insDbParamCollection.Add("@pLinkDescription", parEntLinkContents.LinkDescription);
            insDbParamCollection.AddOutput("@pLinkContentId", DbType.Int32);
            parDbConnector.ExecuteNonQuery("InsertLinkContents", insDbParamCollection);
            parEntLinkContents.LinkContentId = Convert.ToInt32(insDbParamCollection.GetOutPutParameter().Value);
        }
        public void UpdateLinkContentsByLinkContentId(entLinkContents parEntLinkContents, DbConnector parDbConnector)
        {
            DbParamCollection insDbParamCollection = new DbParamCollection();
            insDbParamCollection.Add("@pLinkContentId", parEntLinkContents.LinkContentId);

            insDbParamCollection.Add("@pLinkId", parEntLinkContents.LinkId);
            insDbParamCollection.Add("@pLanguageId", parEntLinkContents.LanguageId);
            insDbParamCollection.Add("@pLinkName", parEntLinkContents.LinkName);
            insDbParamCollection.Add("@pLinkDescription", parEntLinkContents.LinkDescription);
            parDbConnector.ExecuteNonQuery("UpdateLinkContentsByLinkContentId", insDbParamCollection);
        }
        
		#endregion

        public DataTable SelectLinkContentsByLinkId(entLinkContents parEntLinkContents, DbConnector parDbConnector)
        {
            DbParamCollection insDbParamCollection = new DbParamCollection();
            insDbParamCollection.Add("@pLinkId", parEntLinkContents.LinkId);
            return parDbConnector.ExecuteDataTable("SelectLinkContentsByLinkId", insDbParamCollection);
        }
        public void DeleteLinkContentsByLinkId(entLinkContents parEntLinkContents, DbConnector parDbConnector)
        {
            DbParamCollection insDbParamCollection = new DbParamCollection();
            insDbParamCollection.Add("@pLinkId", parEntLinkContents.LinkId);
            parDbConnector.ExecuteNonQuery("DeleteLinkContentsByLinkId", insDbParamCollection);
        }
	}
}